// Virtual calls inside destructors
#include "cppTutorVirtualCallsInsideDestructors.h"

#include <iostream>

using namespace std;

class CVirtualCallsInsideDestructorsBase {
    public:
        virtual ~CVirtualCallsInsideDestructorsBase () { 
            cout << "~CVirtualCallsInsideDestructorsBase ()\n"; 
            f(); 
        }
        virtual void f() { 
            cout << "CVirtualCallsInsideDestructorsBase ::f()\n"; 
        }
};

class CVirtualCallsInsideDestructorsDerived : public CVirtualCallsInsideDestructorsBase  {
    public:
        ~CVirtualCallsInsideDestructorsDerived() { 
            cout << "~CVirtualCallsInsideDestructorsDerived()\n"; 
        }
        void f() { 
            cout << "CVirtualCallsInsideDestructorsDerived::f()\n"; 
        }
};
